<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:a="http://richfaces.org/a4j" template="/layout/template.xhtml">
	<ui:define name="center">
		<c:set value="newFlightLinePopup" var="iModalPanel" />
		<c:set value="frmNewFlightLine" var="frmNewFlightLine" />
		<h:form id="#{frmNewFlightLine}">
			<rich:extendedDataTable id="table_flightLines"
				value="#{flightLine.flightLines}" var="fl" width="100%"
				sortMode="single">
				<rich:column id="col_action" width="5%" sortable="false">
					<h:commandLink id="cmDelete" action="#{flightLine.doDelete()}" immediate="true"
						onclick="return confirm('#{messages['confirmMessage.delete']}');">
						<f:setPropertyActionListener target="#{flightLine.selectedFlightLine}" value="#{fl}"/>
						<h:graphicImage value="/img/delete.png" />
					</h:commandLink>
				</rich:column>
				<rich:column id="col_fromCity" sortable="true" width="35%"
					label="#{flightLinemsgs['fromCity']}">
					<f:facet name="header">
						<h:outputText value="#{flightLinemsgs['fromCity']}" />
					</f:facet>
					<h:outputText value="#{atsmUtils.translate(fl.getFrom())}" />
				</rich:column>
				<rich:column id="col_toCity" sortable="true" width="35%"
					label="#{flightLinemsgs['toCity']}">
					<f:facet name="header">
						<h:outputText value="#{flightLinemsgs['toCity']}" />
					</f:facet>
					<h:outputText value="#{atsmUtils.translate(fl.getTo())}" />
				</rich:column>
				<rich:column id="col_lastChanged" sortable="true" width="25%"
					label="#{flightLinemsgs['lastChanged']}">
					<f:facet name="header">
						<h:outputText value="#{flightLinemsgs['lastChanged']}" />
					</f:facet>
					<h:outputText value="#{fl.getLastChange()}">
						<f:convertDateTime pattern="dd/MM/yyyy" />
					</h:outputText>
				</rich:column>
			</rich:extendedDataTable>
			<br/>
			<h:outputLink value="#" id="newLink">
				<h:graphicImage value="/img/new.png" />
				<rich:componentControl for="newFlightLinePopup" attachTo="newLink"
					operation="show" event="onclick" />
			</h:outputLink>
		</h:form>

		<ui:include src="newFlightLinePopup.xhtml">
			<ui:param value="#{idModalPanel}" name="idModalPanel" />
			<ui:param name="reRender"
				value="#{rich:clientId('table_flightLines')}" />
		</ui:include>
	</ui:define>
</ui:composition>